home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / pff1_3 / pffsel.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  7.6 KB  |  261 lines

  1. VERSION 2.00
  2. Begin Form Selection 
  3.    BackColor       =   &H00808080&
  4.    Caption         =   "PFF for Windows"
  5.    ClientHeight    =   3990
  6.    ClientLeft      =   1005
  7.    ClientTop       =   1470
  8.    ClientWidth     =   4485
  9.    FillStyle       =   3  'Vertical Line
  10.    ForeColor       =   &H00000000&
  11.    Height          =   4395
  12.    Icon            =   PFFSEL.FRX:0000
  13.    Left            =   945
  14.    LinkMode        =   1  'Source
  15.    LinkTopic       =   "Form1"
  16.    MaxButton       =   0   'False
  17.    ScaleHeight     =   3990
  18.    ScaleWidth      =   4485
  19.    Top             =   1125
  20.    Width           =   4605
  21.    Begin CommandButton AllDone 
  22.       BackColor       =   &H00808080&
  23.       Caption         =   "E&xit"
  24.       Height          =   375
  25.       Left            =   3120
  26.       TabIndex        =   7
  27.       Top             =   3480
  28.       Width           =   1095
  29.    End
  30.    Begin CommandButton PrintFile 
  31.       BackColor       =   &H00808080&
  32.       Caption         =   "&Print File"
  33.       Height          =   375
  34.       Left            =   240
  35.       TabIndex        =   6
  36.       Top             =   3480
  37.       Width           =   1095
  38.    End
  39.    Begin PictureBox Picture1 
  40.       BackColor       =   &H00000000&
  41.       Enabled         =   0   'False
  42.       Height          =   510
  43.       Left            =   1425
  44.       Picture         =   PFFSEL.FRX:0302
  45.       ScaleHeight     =   480
  46.       ScaleWidth      =   495
  47.       TabIndex        =   9
  48.       Top             =   3345
  49.       Width           =   525
  50.    End
  51.    Begin CheckBox LineNum 
  52.       BackColor       =   &H00808080&
  53.       Caption         =   "Line &Numbers"
  54.       ForeColor       =   &H0000FF00&
  55.       Height          =   255
  56.       Left            =   1470
  57.       TabIndex        =   3
  58.       Top             =   3045
  59.       Value           =   1  'Checked
  60.       Width           =   1530
  61.    End
  62.    Begin CommandButton FileEdit 
  63.       BackColor       =   &H00808080&
  64.       Caption         =   "&Edit File"
  65.       Height          =   375
  66.       Left            =   3120
  67.       TabIndex        =   8
  68.       Top             =   3000
  69.       Width           =   1095
  70.    End
  71.    Begin CommandButton ViewFile 
  72.       BackColor       =   &H00808080&
  73.       Caption         =   "&View File"
  74.       Height          =   375
  75.       Left            =   240
  76.       TabIndex        =   5
  77.       Top             =   3000
  78.       Width           =   1095
  79.    End
  80.    Begin DriveListBox Drive1 
  81.       BackColor       =   &H00FFFFFF&
  82.       ForeColor       =   &H00000000&
  83.       Height          =   315
  84.       Left            =   240
  85.       TabIndex        =   1
  86.       Top             =   2565
  87.       Width           =   3975
  88.    End
  89.    Begin FileListBox File1 
  90.       BackColor       =   &H00FFFFFF&
  91.       ForeColor       =   &H00000000&
  92.       Height          =   1980
  93.       Left            =   2520
  94.       TabIndex        =   4
  95.       Top             =   495
  96.       Width           =   1695
  97.    End
  98.    Begin TextBox CurrentFile 
  99.       BackColor       =   &H00FFFFFF&
  100.       ForeColor       =   &H00000000&
  101.       Height          =   315
  102.       Left            =   2520
  103.       MousePointer    =   3  'I-Beam
  104.       TabIndex        =   2
  105.       Text            =   "*.*"
  106.       Top             =   120
  107.       Width           =   1695
  108.    End
  109.    Begin DirListBox Dir1 
  110.       BackColor       =   &H00FFFFFF&
  111.       Height          =   2355
  112.       Left            =   240
  113.       TabIndex        =   0
  114.       Top             =   120
  115.       Width           =   2175
  116.    End
  117.    Begin Label Label1 
  118.       BackColor       =   &H00808080&
  119.       Caption         =   "AmSoft Development"
  120.       FontBold        =   0   'False
  121.       FontItalic      =   0   'False
  122.       FontName        =   "MS Sans Serif"
  123.       FontSize        =   8.25
  124.       FontStrikethru  =   0   'False
  125.       FontUnderline   =   0   'False
  126.       ForeColor       =   &H00C0C000&
  127.       Height          =   435
  128.       Left            =   2040
  129.       TabIndex        =   10
  130.       Top             =   3465
  131.       Width           =   1035
  132.    End
  133. Sub AllDone_Click ()
  134.     If nCid% <> 0 Then Result% = CloseComm(nCid%)
  135.     End
  136. End Sub
  137. ' This sub works well only with VGA displays.  For EGA
  138. ' displays, you will want to modify the backcolor
  139. ' properties for the form and controls, and avoid this
  140. ' procedure.
  141. Sub BorderBox (Source As Control, Action As Integer)
  142.     BLeft% = Source.Left - 20     ' Get coordinates
  143.     BTop% = Source.Top - 20
  144.     BWide% = Source.Width + 18
  145.     BHigh% = Source.Height + 18
  146.     ' Action TRUE means draw, FALSE means erase
  147.     If Action Then
  148.         ' Draw a recessed border around Source control
  149.         Line (BLeft%, BTop%)-Step(BWide%, 0), 0
  150.         Line -Step(0, BHigh%), RGB(255, 255, 255)
  151.         Line -Step(-BWide%, 0), RGB(255, 255, 255)
  152.         Line -Step(0, -BHigh%), 0
  153.     Else
  154.         ' Erase border around Source control
  155.         Line (BLeft%, BTop%)-Step(BWide%, 0), Backcolor
  156.         Line -Step(0, BHigh%), Backcolor
  157.         Line -Step(-BWide%, 0), Backcolor
  158.         Line -Step(0, -BHigh%), Backcolor
  159.     End If
  160. End Sub
  161. Sub CurrentFile_KeyPress (KeyAscii As Integer)
  162.     On Error GoTo GetError
  163.     If KeyAscii = 13 Then
  164.         File1.FileName = CurrentFile.Text
  165.     End If
  166.     On Error GoTo 0
  167.     Exit Sub
  168. GetError:
  169.     If Err > 0 Then
  170.         CurrentFile.Text = "*.txt, *.bat, *.me"
  171.         File1.FileName = CurrentFile.Text
  172.     End If
  173.     Resume Next
  174. End Sub
  175. Sub Dir1_Change ()
  176.     File1.Path = Dir1.Path
  177.     ' File1.SetFocus
  178.     If File1.ListCount Then File1.ListIndex = 0
  179.     ChDir File1.Path
  180. End Sub
  181. Sub Dir1_Click ()
  182.     lastchange = DIRSBOXCLICK
  183.     File1.FileName = "*.TXT;*.ME;*.1ST;*.BAT"
  184. End Sub
  185. Sub Drive1_Change ()
  186.     Dir1.Path = Drive1.Drive
  187. End Sub
  188. Sub File1_Click ()
  189.     lastchange = FILEBOXCLICK
  190.     CurrentFile.Text = File1.FileName
  191. End Sub
  192. Sub File1_DblClick ()
  193.     CurrentFile.Text = File1.FileName
  194.     ViewFile_Click
  195.     'ViewFile.SetFocus
  196. End Sub
  197. Sub FileEdit_Click ()
  198.     If File1.FileName = "" Then
  199.         Beep
  200.         MsgBox "No file specified.", 64, "I Need a File"
  201.         Exit Sub
  202.     End If
  203.     ChDrive Drive1.Drive
  204.     ChDir File1.Path
  205.     x = Shell("notepad.exe " + CurrentFile.Text, 1)
  206. End Sub
  207. Sub Form_Load ()
  208.     Show
  209.     ViewFile.SetFocus
  210.     CurrentFile.Text = "*.TXT;*.ME;*.1ST;*.BAT"
  211.     File1.FileName = "*.TXT;*.ME;*.1ST;*.BAT"
  212.     BorderBox CurrentFile, True
  213.     BorderBox Drive1, True
  214.     BorderBox Dir1, True
  215.     BorderBox File1, True
  216.     BorderBox Picture1, True
  217. End Sub
  218. Sub Form_Paint ()
  219.     BorderBox CurrentFile, True
  220.     BorderBox Drive1, True
  221.     BorderBox Dir1, True
  222.     BorderBox File1, True
  223.     BorderBox Picture1, True
  224. End Sub
  225. Sub Form_Unload (Cancel As Integer)
  226.     End
  227. End Sub
  228. Sub LineNum_Click ()
  229.     If LineNum.Value = 1 Then
  230.         Lines = True
  231.     Else
  232.         Lines = False
  233.     End If
  234. End Sub
  235. Sub PrintFile_Click ()
  236.     ChDrive Drive1.Drive
  237.     ChDir File1.Path
  238.     MyFile$ = File1.FileName
  239.     Selection.MousePointer = 11
  240.     FormatFile MyFile$
  241.     Selection.MousePointer = 0
  242. End Sub
  243. Sub SetDraft_Click ()
  244.     LineNum.Enabled = 0  ' Grey the line number choice
  245.     PRETTYPRINT = False
  246. End Sub
  247. Sub SetPretty_Click ()
  248.     PRETTYPRINT = True
  249.     LineNum.Enabled = 1
  250. End Sub
  251. Sub ViewFile_Click ()
  252.     If File1.FileName = "" Then
  253.         Beep
  254.         MsgBox "No file specified.", 64, "I Need a File"
  255.         Exit Sub
  256.     End If
  257.     Selection.Hide
  258.     Viewer.Show MODAL
  259.     Selection.Show
  260. End Sub
  261.